package com.ytrsoft.base;

import com.formdev.flatlaf.ui.FlatComboBoxUI;

import javax.swing.*;
import javax.swing.plaf.basic.ComboPopup;
import java.awt.*;


public class ComboBoxUI<E> extends FlatComboBoxUI {

    private final JComboBox<E> comboBox;

    class FixedComboPopup extends FlatComboPopup {
        public FixedComboPopup(JComboBox combo) {
            super(combo);
            getList().setFixedCellHeight(32);
            setBorderPainted(false);
        }
    }

    public ComboBoxUI(JComboBox<E> comboBox) {
        this.comboBox = comboBox;
    }

    @Override
    protected ComboPopup createPopup() {
        return new FixedComboPopup(comboBox);
    }
}
